//
//  HDCustomComponent.h
//  HDecoration
//
//  Created by koki on 15-4-24.
//  Copyright (c) 2015年 HDecoration. All rights reserved.
//
#define CHTwitterCoverViewHeight      MAX(SCREENWIDTH*8/16, 200)
#import <Foundation/Foundation.h>

@interface NSObject (PerformBlockAfterDelay)
- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay;
@end

@interface UIColor (HexStringToColor)
+(UIColor *)hexStringToColor:(NSString *)stringToConvert;
+(UIColor *)skBackgroundColor;
+(UIColor *)skThemeColor;
@end

@interface UIAlertView (paramAlertView)
@property(strong,nonatomic)NSObject* param;
@end

@interface UIView (UIViewFrame)
@property(nonatomic) CGFloat left;
@property(nonatomic) CGFloat top;
@property(nonatomic, readonly) CGFloat right;
@property(nonatomic, readonly) CGFloat bottom;
@property(nonatomic) CGFloat width;
@property(nonatomic) CGFloat height;
@property (nonatomic, assign) CGFloat centerX;
@property (nonatomic, assign) CGFloat centerY;
@end


@class DOImageView;
@protocol DOImageViewDelegate <NSObject>
- (void)doImageViewLoad:(DOImageView*)imgView img:(UIImage*)img;
@end

@interface DOImageView : UIImageView
@property (nonatomic,strong)UIColor* actIndicatorColor;
@property (nonatomic,copy)NSString* defaultImg;
@property(nonatomic,copy,setter=setImgURLStr:)NSString* imgURLStr;
@property(nonatomic,assign,setter=setImgData:)NSData* imgData;
@property(nonatomic,weak)id<DOImageViewDelegate>delegate;
@property(nonatomic,assign)BOOL needCache;
@property(nonatomic,assign)BOOL enableBlur;
- (void)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)blurTintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage;
+(NSData *)inquiryImageCache:(NSString *)imageUrl;
+(void)savaImageData:(NSData *)imageData forUrl:(NSString *)imageUrl;
+(BOOL)localExistFile:(NSString*)filename;
+(void)setImgUrl:(NSString *)strValue imgView:(UIImageView*)imgView;
@end


@interface GXButton : UIButton
@property(nonatomic,assign)BOOL relayout;
@property(nonatomic,assign)CGRect imageViewFrame;
@property(nonatomic,assign)CGRect titleLabelFrame;
@property(nonatomic,copy)NSObject* object;
@property(nonatomic,assign)CGPoint point;
@property (nonatomic,assign) int  numberCount;
@property (nonatomic,assign) BOOL enableTip;
@property(nonatomic,assign)BOOL showTip;
-(void)playCountAnimation;
@end

//下划线button
@interface HyperlinksButton : UIButton
{
    UIColor *lineColor;
}
-(void)setColor:(UIColor*)color;
@end

@interface MSBtnWithDynamicImg : GXButton
@property(nonatomic,strong)DOImageView *dynamicImgView;
@property(nonatomic,copy)NSString *imgUrl;
@property(nonatomic,copy)NSString *defaultImgUrl;
@end

@protocol GXScrollToolBarDelegate <NSObject>
- (void)scrollToolBarBtnAction:(GXButton*)sender toolBar:(id)toolBar;
- (void)scrollToolBarBtnRepeat;
@end

@interface GXScrollToolBar : UIView
{
    UIScrollView*  _scrollContainer;
    UIButton* curSeletedBtn;
    NSMutableArray *items;
}
@property(nonatomic,strong)UIButton* curSeletedBtn;
@property(nonatomic,weak)id<GXScrollToolBarDelegate> delegate;
@property(nonatomic,strong)DOImageView* bgImageView;
@property(nonatomic,copy,setter=setDataArray:)NSArray* dataArray;

- (id)initWithFrame:(CGRect)frame;
-(void)TransferResponse:(GXButton*)sender;
-(void)setDefaultSelectedIndex:(int)index;
-(GXButton*)getBtnIndex:(int)index;
-(void)initItems;
@end


@interface SXProgressHUD : UIView
+(void) hideAllHUDsForView:(UIView*)view animated:(BOOL)animated;
+(void) showHUDAddedTo:(UIView*)view animated:(BOOL)animated;
@end

@interface SXTextView : UITextView
@property(nonatomic,copy)NSString *placeholder;
@end



@interface SXNavigation : NSObject
{
    UIViewController* rootViewCtr;
    int index;
    NSMutableArray* viewStack;
}
-(void)pushViewController:(UIViewController*)_viewCtr animated:(BOOL)animated;
-(void)popViewControllerAnimated:(BOOL)animated;
-(void)popToRootViewControllerAnimated:(BOOL)animated;
-(void)initWithRootViewController:(UIViewController*)_viewCtr;
-(void)clearData;
@property(nonatomic,assign)BOOL isToRootViewController;
+(SXNavigation*)shareNavigation;
@end



@interface GXLevelControl : UIView
{
    NSMutableArray *items;
}
@property (nonatomic,assign,setter=setLevelNum:)  int levelNum;
@property (nonatomic,assign,setter=setLevelTotal:) int levelTotal ;
@property (nonatomic,strong)NSString* selectedImgUrl;
@property (nonatomic,strong)NSString* normalImgUrl;
@end



@interface DOMarkView : UIView
@property(nonatomic,strong)NSString* title;
@property(nonatomic,strong)NSArray* marks;
@property(nonatomic,strong)NSString* selected;
@property(nonatomic,assign)BOOL isSingle;
@property(nonatomic,assign)BOOL showLine;
@property(nonatomic,strong)UIButton* curBtn;
-(void)cleanSelected;
@end

//标签网格
@interface MSTagCollectionView : UICollectionView
@property(nonatomic,assign)int columnCount;
@property(nonatomic,copy)NSArray *tagArray;
@property(nonatomic,weak)id tagDelegate;
- (id)initWithFrame:(CGRect)frame;
@end

@interface MSTagCollectionLayout : UICollectionViewFlowLayout

@end

@protocol MSFavorBtnDelegate <NSObject>
- (void)favorBtnAction:(GXButton *)sender;
@end
@interface MSFavorBtn : GXButton
@property(nonatomic,weak)id<MSFavorBtnDelegate> delegate;
@end

@interface MSTagView : UIView
@property (nonatomic, strong) UIFont *font;
@property (nonatomic, strong) UIColor *tagBgColor;
@property (nonatomic, strong) UIColor *textColor;
@property (nonatomic, strong) UIColor *tagBorderColor;
-(id)initWithFrame:(CGRect)frame font:(UIFont *)font;
+(CGFloat)tagViewHeight:(NSArray *)tagArray font:(UIFont *)font frame:(CGRect)frame;
@property(nonatomic,strong)NSArray *tagArray;
@end

@class MSHomeBtnListView;
@protocol MSHomeBtnListViewDelegate <NSObject>
- (void)clickBtnListView:(MSHomeBtnListView *)btnListView onIndex:(NSInteger)btnIndex;
@end
@interface MSHomeBtnListView : UIView
@property(nonatomic,copy)NSArray *dataArray;
@property(nonatomic,weak)id<MSHomeBtnListViewDelegate> delegate;
@end

@interface MSSwitch : UIControl
@property(nonatomic,strong)UIImage *trackOnImage;
@property(nonatomic,strong)UIImage *trackOffImage;
@property(nonatomic,strong)UIImage *thumbOnImage;
@property(nonatomic,strong)UIImage *thumbOffImage;
@property(nonatomic,assign,getter=isOn)BOOL on;
@end

@interface MSPageControl : UIPageControl
@property (nonatomic, strong) UIImage *imagePageStateNormal;
@property (nonatomic, strong) UIImage *imagePageStateHighlighted;
@end


@interface CHTwitterCoverView : UIImageView
@property (nonatomic, weak) UIScrollView *scrollView;
- (id)initWithFrame:(CGRect)frame andContentTopView:(UIView*)view;
@end


@interface UIScrollView (TwitterCover)
@property(nonatomic,weak)CHTwitterCoverView *twitterCoverView;
- (void)addTwitterCoverWithImage:(UIImage*)image;
- (void)addTwitterCoverWithImage:(UIImage*)image withTopView:(UIView*)topView;
- (void)removeTwitterCoverView;
@end

@interface UIImage (Blur)
-(UIImage *)boxblurImageWithBlur:(CGFloat)blur;
@end

@interface NSTimer (MSBlock)
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval
                                         block:(void(^)())block
                                       repeats:(BOOL)repeats;
@end













